<template>
	<!-- <view> -->
		<!-- <web-view :src="path+Purl"></web-view> -->
		<!-- <iframe src="../../../../static/2_1697033813446.pdf" width="100%" height="100%"></iframe> -->
	<!-- <ss-preview fileUrl="../../../../static/2_1697033813446.pdf" file-type="2"></ss-preview> -->
	<!-- <view>
	    <web-view :src="allUrl"></web-view>
	  </view> -->
	 <!-- <view id="pdf"></view> -->
	 <!-- <view class="img-box">
	 	<image :src="this.path+imgurl" mode="widthFix"></image>
	 </view>
	</view> -->
	<view class="content">
		<view class="img-box">
			<image referrerPolicy="no-referrer"  :src="imgaePath"  mode="widthFix" @click="zhanshitupian"></image>
		<view class="enter-btn" style="justify-content: space-around;">
			<button v-if="false" @click="submit('../singename')" style="width:40%; ">直接签约</button>
			<button v-if="false" @click="submit('../contracter')" style="width:40%; background-color: white; border: solid 1px #2f67ff; color: #2f67ff;">下放签约</button>
		</view>
		</view>
		<view class="enter-btn">
			<button @click="tocontract">返回首页</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				imgurls:[],
				imgurl:'',
				surl:'https://images.weserv.nl/?url=',
        headPath: ''
			}
		},
    computed:{
      imgaePath(){
        // console.log(this.headPath + this.imgurl);
        // return (this.headPath + this.imgurl).replace(/\\/g, '');
        console.log(this.imgurl);
        return (this.imgurl).replace(/\\/g, '');
      }
    },
		onLoad(options) {
			this.imgurl=options.id
			console.log(this.path+this.imgurl);
			this.$on('contractimg',res=>{
				console.log('图片路径',res);
			})
		},
		methods: {
			tocontract(){// 5劳资专员-个人 4劳工 3包工头 2劳资专员-项目 1管理员
				if(uni.getStorageSync('usertype')==2){
					uni.redirectTo({
						url:'../labourSigning'
					})
				}else if(uni.getStorageSync('usertype')!=2){
					uni.redirectTo({
						url:'../signing'
					})
				}else{
					uni.switchTab({
						url:'../../home/index'
					})
				}
			},
			zhanshitupian(){
				this.imgurls.push(this.imgaePath)
				uni.previewImage({
					urls:this.imgurls
				})
			},
			submit(url){
				uni.redirectTo({
					url:url
				})
			},
		},
    created() {
      this.headPath = this.path
    },
	onUnload() {
		uni.$off('contractimg')
	}
	}
</script>

<style lang="scss" scoped>
	.enter-btn{
		position: fixed;
		bottom: 10px;
		width: 100%;
		display: flex;
		justify-content: center;
		align-items: center;
		button{
			width: 80%;
			background-color: #2f67ff;
			height: 35px;
			line-height: 35px;
			color: white;
			font-size: 14px;
		}
	}
.content{
	width: 750rpx;
	height: 100vh;
	.img-box{
		width: 95%;
		margin: 0 auto;
		image{
			width: 100%;
		}
	}
	.kongbai{
		width: 100%;
		height: 60rpx;
	}
	.enter-btn{
		position: fixed;
		bottom: 10px;
		width: 100%;
		display: flex;
		justify-content: center;
		align-items: center;
		button{
			width: 80%;
			background-color: #2f67ff;
			height: 35px;
			line-height: 35px;
			color: white;
			font-size: 14px;
		}
	}
}
</style>
